import request from '@/utils/request'

export default{
    // 获取供应商列表数据
    getList(){
        return request({
            url:'/supplier/list',
            method:'get'
        })
    },
    // 分页搜索方法
    search(page,size,searchMap){
        return request({
            url:`/supplier/list/search/${page}/${size}`,
            method:'post',
            data:searchMap
        })
    },
    // 新增供应商
    addSupplier(beSubmittedData){
        return request({
            url:'/supplier',
            method:'post',
            data:beSubmittedData
        })
    },
    // 通过ID查询供应商的信息
    getSupplierInformationById(id){
        return request({
            url:`/supplier/${id}`,
            method:'get'
        })
    },
    // 更新供应商的信息
    updateSupplierInformation(beSubmittedData){
        return request({
            url:`/supplier/${beSubmittedData.id}`,
            method:'put',
            data:beSubmittedData
        })
    },
    // 通过ID删除供应商的信息
    deleteSupplierInformationById(id){
        return request({
            url:`/supplier/${id}`,
            method:'delete'
        })
    }
}